package com.ly.dingtalk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dingtalk.api.response.OapiV2UserGetResponse.UserGetResponse;
import com.ly.dingtalk.service.user.impl.DingUserHandler;

import cn.hutool.json.JSONUtil;

@RestController
public class UserController {
    @Autowired
    @Qualifier("dingUserHandler")
    private DingUserHandler dingUserHandler;
    
    @GetMapping(path = {"/findUser"})
    public String findUser(String mobile) {
        UserGetResponse findUserByMobile = dingUserHandler.findUserByMobile(mobile);
        return JSONUtil.toJsonPrettyStr(findUserByMobile);
    }

}
